<!DOCTYPE html>
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  <meta name="description" content="tong.li&#39;s blog">
  <meta name="keyword" content="彤哥哥博客，95后技术爱好者,现就职于同程旅行/同程艺龙上海分公司，专注于互联网技术分享的平台。">
  
    <link rel="shortcut icon" href="/css/images/icon.png">
  
  <title>
    
      Linux运维-实用的小脚本 | 彤哥哥的博客
    
  </title>
  <link href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  <link href="https://cdn.staticfile.org/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
  <link href="https://cdn.staticfile.org/highlight.js/9.12.0/styles/tomorrow-night.min.css" rel="stylesheet">
  
<link rel="stylesheet" href="/css/style.css">

  
  <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://cdn.staticfile.org/geopattern/1.2.3/js/geopattern.min.js"></script>
  <script src="https://cdn.staticfile.org/nprogress/0.2.0/nprogress.min.js"></script>
  
    
<script src="/js/qrious.js"></script>

  
  
  
  
    <!-- MathJax support START -->
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="https://cdn.staticfile.org/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <!-- MathJax support END -->
  


  
  
    
<script src="/js/local-search.js"></script>


<meta name="generator" content="Hexo 5.4.2"></head>
<div class="wechat-share">
  <img src="/css/images/logo.png" />
</div>
  <body>
    <header class="header fixed-header">
  <div class="header-container">
    <a class="home-link" href="/">
      <div class="logo"></div>
      <span>彤哥哥的博客</span>
    </a>
    <ul class="right-list">
      
        <li class="list-item">
          
            <a href="/" class="item-link">主页</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/series/" class="item-link">分类</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/tags/" class="item-link">标签</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/archives/" class="item-link">归档</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/project/" class="item-link">项目</a>
          
        </li>
      
        <li class="list-item">
          
            <a href="/about/" class="item-link">关于</a>
          
        </li>
      
      
        <li class="menu-item menu-item-search right-list">
    <a role="button" class="popup-trigger">
        <i class="fa fa-search fa-fw"></i>
    </a>
</li>
      
    </ul>
    <div class="menu">
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </div>
    <div class="menu-mask">
      <ul class="menu-list">
        
          <li class="menu-item">
            
              <a href="/" class="menu-link">主页</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/series/" class="menu-link">分类</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/tags/" class="menu-link">标签</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/archives/" class="menu-link">归档</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/project/" class="menu-link">项目</a>
            
          </li>
        
          <li class="menu-item">
            
              <a href="/about/" class="menu-link">关于</a>
            
          </li>
        
      </ul>
    </div>
    
      <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
            <span class="search-icon">
                <i class="fa fa-search"></i>
            </span>
            <div class="search-input-container">
                <input autocomplete="off" autocapitalize="off"
                    placeholder="Please enter your keyword(s) to search." spellcheck="false"
                    type="search" class="search-input">
            </div>
            <span class="popup-btn-close">
                <i class="fa fa-times-circle"></i>
            </span>
        </div>
        <div id="search-result">
            <div id="no-result">
                <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
            </div>
        </div>
    </div>
</div>
    
  </div>
</header>

    <div id="article-banner">
  <h2>Linux运维-实用的小脚本</h2>
  <p class="post-date">2021-08-01</p>
  <div class="arrow-down">
    <a href="javascript:;"></a>
  </div>
</div>
<main class="app-body flex-box">
  <!-- Article START -->
  <article class="post-article">
    <section class="markdown-content"><h1 id="自动化安装JDK脚本"><a href="#自动化安装JDK脚本" class="headerlink" title="自动化安装JDK脚本"></a>自动化安装JDK脚本</h1><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash">!/bin/bash</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">author: tong.li</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">description: JDk安装自动脚本</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash"><span class="built_in">date</span>: 2021-07-30 15:45:22</span></span><br><span class="line"></span><br><span class="line">tar -zxvf /usr/local/bin/jdk-8u291-linux-x64.tar.gz</span><br><span class="line">cat &gt;&gt; /etc/profile &lt;&lt; EOF</span><br><span class="line">export JAVA_HOME=/usr/local/bin/jdk1.8.0_291</span><br><span class="line">export PATH=\$JAVA_HOME/bin:\$PATH</span><br><span class="line">EOF</span><br><span class="line">source /etc/profile</span><br><span class="line">java -version</span><br></pre></td></tr></table></figure>

<h1 id="简单的跳板机脚本"><a href="#简单的跳板机脚本" class="headerlink" title="简单的跳板机脚本"></a>简单的跳板机脚本</h1><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash">!/bin/bash</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">author: tong.li</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">description: 服务器免密登录跳转脚本，尽可能进行SSH公钥免密登录</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash"><span class="built_in">date</span>: 2021-07-30 14:45:22</span></span><br><span class="line"></span><br><span class="line">echo &quot;-------------------------------------------服务器列表-----------------------------&quot;</span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">声明一个Map，保存所有的机器</span></span><br><span class="line">declare -A serverMap=([&quot;1&quot;]=&quot;192.168.1.5&quot; [&quot;2&quot;]=&quot;192.168.1.6&quot; [&quot;3&quot;]=&quot;192.168.1.7&quot; [&quot;4&quot;]=&quot;192.168.1.8&quot; [&quot;5&quot;]=&quot;192.168.1.10&quot; [&quot;6&quot;]=&quot;192.168.1.11&quot; [&quot;7&quot;]=&quot;192.168.1.12&quot;)</span><br><span class="line">for key in $&#123;!serverMap[*]&#125;; do</span><br><span class="line">    echo $key&#x27;.&#x27;  $&#123;serverMap[$key]&#125;</span><br><span class="line">done</span><br><span class="line">echo &quot;-----------请输入对应的序号登录对应的服务器-----------------------------------------&quot;</span><br><span class="line">read -p &quot;please input server seq: &quot; seq</span><br><span class="line">if [ &quot;$seq&quot; == &quot;&quot; ]</span><br><span class="line">then</span><br><span class="line">     echo &quot;您必须输入一个序号, 请重试!&quot;</span><br><span class="line">     exit 0</span><br><span class="line">fi</span><br><span class="line">l=$&#123;#serverMap[@]&#125;</span><br><span class="line">if test $[seq] -lt $[1] || test $[seq] -gt $[l]</span><br><span class="line">then</span><br><span class="line">  echo &quot;无效的服务器,请退出重试&quot;</span><br><span class="line">  exit 0</span><br><span class="line">fi</span><br><span class="line">ssh root@$&#123;serverMap[$seq]&#125;</span><br><span class="line">echo 服务器IP为: $&#123;serverMap[$seq]&#125;退出成功</span><br></pre></td></tr></table></figure>

<h1 id="Spring-Boot-Jar启动脚本"><a href="#Spring-Boot-Jar启动脚本" class="headerlink" title="Spring Boot Jar启动脚本"></a>Spring Boot Jar启动脚本</h1><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta prompt_">#</span><span class="language-bash">!/bin/bash</span></span><br><span class="line"><span class="meta prompt_"># </span><span class="language-bash">Author tong.li</span></span><br><span class="line"><span class="meta prompt_">#</span><span class="language-bash"><span class="comment"># UPDATE 2021-07-31</span></span></span><br><span class="line">version=&quot;1.0.1&quot;</span><br><span class="line"></span><br><span class="line">appName=$2</span><br><span class="line">if [ -z $appName ];then</span><br><span class="line">    appName=`ls -t |grep .jar$ |head -n1`</span><br><span class="line">fi</span><br><span class="line"></span><br><span class="line">function start()</span><br><span class="line">&#123;</span><br><span class="line">	count=`ps -ef |grep java|grep $appName|wc -l`</span><br><span class="line">	if [ $count != 0 ];then</span><br><span class="line">		echo &quot;Maybe $appName is running, please check it...&quot;</span><br><span class="line">	else</span><br><span class="line">		echo &quot;The $appName is starting...&quot;</span><br><span class="line"><span class="meta prompt_">		# </span><span class="language-bash">定义激活配置以及 启动参数</span></span><br><span class="line">		nohup java -XX:+UseG1GC -XX:+HeapDumpOnOutOfMemoryError -Xms1024M -Xmx1024M -jar -Dspring.profiles.active=product ./$appName  &gt; /dev/null   2&gt;&amp;1 &amp;</span><br><span class="line">		echo &quot;pid is $!&quot; </span><br><span class="line">		echo Start Successed!</span><br><span class="line">	fi</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">function stop()</span><br><span class="line">&#123;</span><br><span class="line">	appId=`ps -ef |grep java|grep $appName|awk &#x27;&#123;print $2&#125;&#x27;`</span><br><span class="line">	if [ -z $appId ];then</span><br><span class="line">	    echo &quot;Maybe $appName not running, please check it...&quot;</span><br><span class="line">	else</span><br><span class="line">        echo &quot;The $appName is stopping...&quot;</span><br><span class="line">        kill $appId</span><br><span class="line">	fi</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">function restart()</span><br><span class="line">&#123;</span><br><span class="line">    # get release version</span><br><span class="line">    releaseApp=`ls -t |grep .jar$ |head -n1`</span><br><span class="line">    </span><br><span class="line">    # get last version </span><br><span class="line">    lastVersionApp=`ls -t |grep .jar$ |head -n2 |tail -n1`</span><br><span class="line"></span><br><span class="line">    appName=$lastVersionApp</span><br><span class="line">    stop</span><br><span class="line">    for i in &#123;5..1&#125;</span><br><span class="line">    do</span><br><span class="line">        echo -n &quot;$i &quot;</span><br><span class="line">        sleep 1</span><br><span class="line">    done</span><br><span class="line">    echo 0</span><br><span class="line">    </span><br><span class="line">    backup</span><br><span class="line">    </span><br><span class="line">    appName=$releaseApp</span><br><span class="line">    start</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">function backup() </span><br><span class="line">&#123;</span><br><span class="line">    # get backup version</span><br><span class="line">    backupApp=`ls |grep -wv $releaseApp$ |grep .jar$`</span><br><span class="line">    </span><br><span class="line">    # create backup dir</span><br><span class="line">    if [ ! -d &quot;backup&quot; ];then</span><br><span class="line">        mkdir backup</span><br><span class="line">    fi</span><br><span class="line">    </span><br><span class="line">    # backup</span><br><span class="line">    for i in $&#123;backupApp[@]&#125;</span><br><span class="line">    do</span><br><span class="line">        echo &quot;backup&quot; $i</span><br><span class="line">        mv $i backup</span><br><span class="line">    done</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">function status()</span><br><span class="line">&#123;</span><br><span class="line">    appId=`ps -ef |grep java|grep $appName|awk &#x27;&#123;print $2&#125;&#x27;`</span><br><span class="line">	if [ -z $appId ] </span><br><span class="line">	then</span><br><span class="line">	    echo -e &quot;\033[31m Not running \033[0m&quot; </span><br><span class="line">	else</span><br><span class="line">	    echo -e &quot;\033[32m Running [$appId] \033[0m&quot; </span><br><span class="line">	fi</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line">function usage()</span><br><span class="line">&#123;</span><br><span class="line">    echo &quot;Usage: $0 &#123;start|stop|restart|status|stop -f&#125;&quot;</span><br><span class="line">    echo &quot;Example: $0 start&quot;</span><br><span class="line">    exit 1</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">case $1 in</span><br><span class="line">	start)</span><br><span class="line">	start;;</span><br><span class="line"></span><br><span class="line">	stop)</span><br><span class="line">	stop;;</span><br><span class="line">	</span><br><span class="line">	restart)</span><br><span class="line">	restart;;</span><br><span class="line">	</span><br><span class="line">	status)</span><br><span class="line">	status;;</span><br><span class="line">	</span><br><span class="line">	*)</span><br><span class="line">	usage;;</span><br><span class="line">esac</span><br></pre></td></tr></table></figure>
</section>
    <!-- Tags START -->
    
      <div class="tags">
        <span>Tags:</span>
        
  <a href="/tags#Linux" >
    <span class="tag-code">Linux</span>
  </a>

      </div>
    
    <!-- Tags END -->
    <!-- NAV START -->
    
  <div class="nav-container">
    <!-- reverse left and right to put prev and next in a more logic postition -->
    
      <a class="nav-left" href="/2021/05/27/Netty%E4%B8%93%E9%A2%98-Netty%E8%BF%9B%E9%98%B6/">
        <span class="nav-arrow">← </span>
        
          Netty专题-Netty进阶
        
      </a>
    
    
      <a class="nav-right" href="/2021/08/02/Linux%E8%BF%90%E7%BB%B4-MySQL%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/">
        
          Linux运维-MySQL安装与配置
        
        <span class="nav-arrow"> →</span>
      </a>
    
  </div>

    <!-- NAV END -->
    <!-- 打赏 START -->
    
      <div class="money-like">
        <div class="reward-btn">
          赏
          <span class="money-code">
            <span class="alipay-code">
              <div class="code-image"></div>
              <b>使用支付宝打赏</b>
            </span>
            <span class="wechat-code">
              <div class="code-image"></div>
              <b>使用微信打赏</b>
            </span>
          </span>
        </div>
        <p class="notice">若你觉得我的文章对你有帮助，欢迎点击上方按钮对我打赏</p>
      </div>
    
    <!-- 打赏 END -->
    <!-- 二维码 START -->
    
      <div class="qrcode">
        <canvas id="share-qrcode"></canvas>
        <p class="notice">扫描二维码，分享此文章</p>
      </div>
    
    <!-- 二维码 END -->
    
      <!-- Utterances START -->
      <div id="utterances"></div>
      <script src="https://utteranc.es/client.js"
        repo="ltyeamin/blogtalks"
        issue-term="pathname"
        theme="github-light"
        crossorigin="anonymous"
        async></script>    
      <!-- Utterances END -->
    
  </article>
  <!-- Article END -->
  <!-- Catalog START -->
  
    <aside class="catalog-container">
  <div class="toc-main">
    <strong class="toc-title">Catalog</strong>
    
      <ol class="toc-nav"><li class="toc-nav-item toc-nav-level-1"><a class="toc-nav-link" href="#%E8%87%AA%E5%8A%A8%E5%8C%96%E5%AE%89%E8%A3%85JDK%E8%84%9A%E6%9C%AC"><span class="toc-nav-text">自动化安装JDK脚本</span></a></li><li class="toc-nav-item toc-nav-level-1"><a class="toc-nav-link" href="#%E7%AE%80%E5%8D%95%E7%9A%84%E8%B7%B3%E6%9D%BF%E6%9C%BA%E8%84%9A%E6%9C%AC"><span class="toc-nav-text">简单的跳板机脚本</span></a></li><li class="toc-nav-item toc-nav-level-1"><a class="toc-nav-link" href="#Spring-Boot-Jar%E5%90%AF%E5%8A%A8%E8%84%9A%E6%9C%AC"><span class="toc-nav-text">Spring Boot Jar启动脚本</span></a></li></ol>
    
  </div>
</aside>
  
  <!-- Catalog END -->
</main>

<script>
  (function () {
    var url = 'http://example.com/2021/08/01/Linux运维-实用的小脚本/';
    var banner = ''
    if (banner !== '' && banner !== 'undefined' && banner !== 'null') {
      $('#article-banner').css({
        'background-image': 'url(' + banner + ')'
      })
    } else {
      $('#article-banner').geopattern(url)
    }
    $('.header').removeClass('fixed-header')

    // error image
    $(".markdown-content img").on('error', function() {
      $(this).attr('src', '/css/images/error_icon.png')
      $(this).css({
        'cursor': 'default'
      })
    })

    // zoom image
    $(".markdown-content img").on('click', function() {
      var src = $(this).attr('src')
      if (src !== '/css/images/error_icon.png') {
        var imageW = $(this).width()
        var imageH = $(this).height()

        var zoom = ($(window).width() * 0.95 / imageW).toFixed(2)
        zoom = zoom < 1 ? 1 : zoom
        zoom = zoom > 2 ? 2 : zoom
        var transY = (($(window).height() - imageH) / 2).toFixed(2)

        $('body').append('<div class="image-view-wrap"><div class="image-view-inner"><img src="'+ src +'" /></div></div>')
        $('.image-view-wrap').addClass('wrap-active')
        $('.image-view-wrap img').css({
          'width': `${imageW}`,
          'transform': `translate3d(0, ${transY}px, 0) scale3d(${zoom}, ${zoom}, 1)`
        })
        $('html').css('overflow', 'hidden')

        $('.image-view-wrap').on('click', function() {
          $(this).remove()
          $('html').attr('style', '')
        })
      }
    })
  })();
</script>


  <script>
    var qr = new QRious({
      element: document.getElementById('share-qrcode'),
      value: document.location.href
    });
  </script>






    <div class="scroll-top">
  <span class="arrow-icon"></span>
</div>
    <footer class="app-footer">
  <p class="copyright">
    &copy; 2024 | Proudly powered by <a href="https://hexo.io" target="_blank">Hexo</a>
    <br>
    Theme by <a target="_blank" rel="noopener" href="https://github.com/ltyeamin">tong.li</a>
  </p>
</footer>

<script>
  function async(u, c) {
    var d = document, t = 'script',
      o = d.createElement(t),
      s = d.getElementsByTagName(t)[0];
    o.src = u;
    if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
    s.parentNode.insertBefore(o, s);
  }
</script>
<script>
  async("https://cdn.staticfile.org/fastclick/1.0.6/fastclick.min.js", function(){
    FastClick.attach(document.body);
  })
</script>

<script>
  var hasLine = 'true';
  async("https://cdn.staticfile.org/highlight.js/9.12.0/highlight.min.js", function(){
    $('figure pre').each(function(i, block) {
      var figure = $(this).parents('figure');
      if (hasLine === 'false') {
        figure.find('.gutter').hide();
      }
      hljs.configure({useBR: true});
      var lang = figure.attr('class').split(' ')[1] || 'code';
      var codeHtml = $(this).html();
      var codeTag = document.createElement('code');
      codeTag.className = lang;
      codeTag.innerHTML = codeHtml;
      $(this).attr('class', '').empty().html(codeTag);
      figure.attr('data-lang', lang.toUpperCase());
      hljs.highlightBlock(block);
    });
  })
</script>
<!-- Baidu Tongji -->



<script src='https://cdn.staticfile.org/mermaid/8.11.2/mermaid.min.js'></script>



<script src="/js/script.js"></script>


  </body>
</html>